import MainItemUI = layaUI.Main.item.MainItemUI;

class MainItem extends MainItemUI{
    constructor() {
        super();
        this.on(Laya.Event.CLICK, this, this.onClick);
    }

    private index:number;
    public ethCar:data.EthCar;
    public setData(value:data.EthCar,index:number):void{
        this.ethCar = value;
        this.index = index;
        var str:string = value.Name + " 售价："+ value.Price+"eth";
        this.txtName.text = str;

    }

    public onClick():void{
        MainView.getInstance().selectIndexItem(this,this.index);
    }
}